#ifndef MYMEDIA_H
#define MYMEDIA_H

#include <QObject>

//媒体控制
class QMediaPlayer;
class QMediaPlaylist;
class MyMedia : public QObject
{
    Q_OBJECT
private:
    explicit MyMedia(QObject *parent = nullptr);

public:
    //获取单例对象
    static MyMedia *getObject();
    //播放
    void play();
    //暂停
    void pause();
    //停止
    void stop();

private:
    static MyMedia *mm;                     //单例对象
    QMediaPlayer *player = nullptr;         //播放对象
    QMediaPlaylist *playlist = nullptr;     //播放列表
};

#endif // MYMEDIA_H
